<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="utf-8">
    <title>新增类型</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" th:href="@{/js/layui/css/layui.css}"  media="all" />
    <link rel="stylesheet" th:href="@{/css/public.css}"  media="all" />
</head>
<body style="-webkit-backface-visibility: hidden;">
<div style="width:100%;-webkit-backface-visibility: hidden;">
    <form class="layui-form layui-row" style="text-align: center;" >
        <div class="layui-row layui-col-space10" style="text-align: center;position: absolute;top: 10px;left: 0px;bottom: 50px;overflow-y: auto;overflow-x: hidden;width: 100%">
            <div class="layui-form-item magt3">
                <label class="layui-form-label">类型名称:</label>
                <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="required" placeholder="请输入类型名称" autocomplete="off" class="layui-input"
                           required th:value="${industryType?.name}">
                </div>
            </div>

            <th:block th:if="${businessTypeBases!=null && !businessTypeBases.isEmpty()}">
                <div class="layui-form-item magt3">
                    <label class="layui-form-label">所属业务类型:</label>
                    <div class="layui-input-block">
                        <select name="parentId" lay-filter="businessTypeBaseId" id="businessTypeBaseId"  lay-search="" lay-verify="required" >
                            <option value="">请选择所属业务类型</option>
                            <option th:each="it:${businessTypeBases}"  th:value="${it.id}" th:text="${it.name}"
                                    th:selected="(${it.id} == ${industryType?.businessTypeBaseId})"></option>
                        </select>
                    </div>
                </div>
            </th:block>


            <th:block th:if="${parentIndustryTypes!=null && !parentIndustryTypes.isEmpty()}">
                <div class="layui-form-item magt3">
                    <label class="layui-form-label">所属类型:</label>
                    <div class="layui-input-block">
                            <select name="parentId" lay-filter="parentId" id="parentId"  lay-search="" lay-verify="required"  >
                                <option value="">请选择所属类型</option>
                                <option th:each="it:${parentIndustryTypes}"  th:value="${it.id}" th:text="${it.name}"
                                        th:selected="(${it.id} == ${industryType?.parentId})"></option>
                            </select>
                    </div>
                </div>
            </th:block>

            <div class="layui-form-item"  style="display: none" >
                <input type="text" name="id" th:value="${industryType?.id}" />
            </div>
        </div>
        <div style="position:absolute;left: 0px;bottom: 0px; width: 100%;height: 50px;background-color: #f2f2f2;padding: 0px;display: none">
            <button type="button" class="layui-btn" lay-submit lay-filter="save" style="width: 100px;float: right;margin-top: 7px;margin: 5px 5px;">保存</button>
            <button type="button" class="layui-btn"  id="cancel"  style="width: 100px;margin-top: 7px;background-color: #b2b2b2;float: right;margin: 5px 5px;" >取消</button>
        </div>
    </form>
</div>
<script th:inline="javascript">
    const baseUrl = [[${#servletContext.contextPath}]];
</script>
<script type="text/javascript"   th:src="@{/js/jquery-1.7.2.min.js}"></script>
<script type="text/javascript"   th:src="@{/js/layui/layui.js}"></script>
<script type="text/javascript"   th:src="@{/js/page/knowledgeBase/type/saveOrUpdateIndustryType.js}"></script>
<script type="text/javascript"   th:src="@{/js/page/utils.js}"></script>
</body>
</html>